clear; clc;

sbase=100e3;
v_primary=250;
Vsecondary=200e3;

w=2*pi*50;

I_sec=0.5;

R_pu=0.01;
X_pu=0.05;
L_pu=0.01;

R_actual=R_pu*(Vsecondary^2)/sbase
x_actual=X_pu*(Vsecondary^2)/sbase
RL_actual=L_pu*(Vsecondary^2)/sbase

Xc=(2*Vsecondary)/I_sec

%resonance
E_L=Xc-x_actual
L_siries=E_L/w

%input voltage of the transformer 
Rtot=RL_actual+R_actual
V_Sec=I_sec *Rtot
Vp=V_Sec*(v_primary/Vsecondary)

